// 动画方法,参数说明:执行时间,延迟时间,移动效果,具体方法,结束后执行方法。
    UIView.animateWithDuration(0.3, delay: 0.1, options: .CurveEaseOut, animations: {
        // 位移
        // self.view.frame.origin.x = 100
        // 扭曲
        // self.view.transform.c = 0.8
        // 旋转
        self.view.transform = CGAffineTransformMakeRotation(CGFloat(90*M_PI/180.0))
        // 缩放
        self.view.transform = CGAffineTransformScale(self.view.transform, 0.8, 0.8)

        println("\(self.view.frame.origin.x)")

     }, completion: {
        finished in println("basket doors opened!")
        UIView.animateWithDuration(0.2, delay: 0.0, options: nil, animations: {
            self.view.frame.origin.x = 520.0
        }, completion: nil)
    })

最简单的demo。


kelvinlee
867 声望9 粉丝

希望可以成为全栈.